package id;

import com.github.yitter.contract.IdGeneratorOptions;
import com.github.yitter.idgen.YitIdHelper;

/**
 * 分布式id生成
 * <a href="https://github.com/yitter/IdGenerator/tree/master">IdGenerator</a>
 */
public class IdGenerator {
    public static void main(String[] args) {
        short workId = 62;
        IdGeneratorOptions options = new IdGeneratorOptions(workId);

        YitIdHelper.setIdGenerator(options);

        for (int i = 0; i < 1000; i++) {
            System.out.println(YitIdHelper.nextId());
        }
    }
}
